var app = getApp()
Page( {
  data: {
    motto: 'Hello World',
    userInfo: {},
  },
  //事件处理函数
  bindViewTap: function() {
    wx.navigateTo( {
      url: '../logs/logs'
    })
  },
  onLoad: function() {
    if(app.globalData.userToken == null){
      wx.redirectTo({
        url:"../login/login"
      })
    }
    console.log( 'onLoad' )
    var that = this
    that.setData({
      motto:app.globalData.userToken
    });
    //调用应用实例的方法获取全局数据
    app.getUserInfo( function( userInfo ) {
      //更新数据
      that.setData( {
        userInfo: userInfo,
      })
      
    })
  }
})
